const cloud = require('wx-server-sdk')

const db = cloud.database()
const _ = db.command

exports.main = async (event,context)=>{
	let result = await db.collection('user_info').where({
		username:new db.RegExp({
			regexp: event.name,
			options: 'i',
		  })
	}).limit(12).skip(event.start*12).get();
	console.log(result)
	return {'msg':'ok','data':result.data}
}